package com.chepaandvasia.dao;

import java.util.Date;
import java.util.List;

import com.chepaandvasia.entities.Car;
import com.chepaandvasia.entities.Customer;
import com.chepaandvasia.entities.Order;

public interface OrderDAO {

    /*
     * This method inserts Order order in the database.
     * While inserting, order is given unique id
     * @param order instance of Order  to be created     
     */
    public void create(Order order);

    /*
     * This method get instance of Order, specified with given id, from database.
     * @param id id of Order to be retrieved
     * @return instance of Order with given id     
     */
    public Order get(Long id);

    /*
     * This method updates state of Order into database
     * @param order instance of Order to be updated in database     * 
     */
    public void update(Order order);

    /*
     * This method removes Order order from database.
     * @param order instance of Order to be removed
     */
    public void remove(Order order);
    
    /*
     * This method finds all available orders for given customer.
     * @param customer instance of Customer
     * @return list of Orders of given customer
     */
    public List<Order> findAllOrdersForCustomer(Customer position);

    /*
     * This method finds all available orders for given car.
     * @param car instance of Car
     * @return list of Orders of given car
     */
    public List<Order> findAllOrdersForCar(Car position);
    /*
     * This method find all orders .
     * @return list of all Orders 
     */
    public List<Order> findAllOrders();
        
    /*
     * This methd return all Orders with selected date
     * @param dateOfOrder = Date
     * @return list of all Orders with this dateOfOrder
     */
    public List<Order> getOrdersByDate(Date dateOfOrder);
    
    /*
     * This methd return all Orders with selected numberOfDrivenKms
     * @param  numberOfDrivenKms=int
     * @return list of all Orders with this numberOfDrivenKms
     */
    public List<Order> getOrdersByNumberOfDrivenKms(int numberOfDrivenKms);
} 
